<?php

require_once( "application.php" );
require_once( "EditApp.class.php" );

$app	=	new Application();

$app->IsAuthenticationRequired(TRUE);


$editApp	=	new	EditApp();

$action		=	$_REQUEST['action'];

if( !empty( $editApp ) ){

	$application_id		=	$editApp->id;
	$nome				=	$editApp->nome;
	$detalhe			=	$editApp->detalhe;
	$url				=	$editApp->url;
	$user_id			=	$editApp->user_id;
	$linguagem			=	$editApp->linguagem;
	$codigo_fonte_livre	=	$editApp->codigo_fonte_livre;
	$application_classification_id		=	$editApp->application_classification_id;
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="robots" content="index, follow" />
	<meta name="keywords" content="brunom4ciel" />
	<meta name="description" content="Semantic web" />
	<meta name="generator" content="brunom4ciel" />
	<title>Bruno Maciel</title>
  
  	<link rel="stylesheet" href="css/generic.css" type="text/css" />

</head>
<body class="contentpane">
<a href="index.php">Home</a>	
<h1>Editar Aplicação da Web Semântica</h1> 
                 
	<form class="Forminput" action="<?php echo $_SERVER['PHP_SELF']?>" method="POST">
		<input type="hidden" name="action" value="<?php echo (empty($action)? "edit":$action);?>">
		<input type="hidden" name="application_id" value="<?php echo $application_id;?>">
	
	    <fieldset style="width:1024px;">
	        <p style="text-align:left;"><label for="nome">Nome</label>&nbsp;						
	        <input type="text" name="nome" value="<?php echo $nome; ?>" tabindex="0"  minlength="2" maxlength="50" size="70"  /></p>    
	        
	                           	
	       	
	        <p style="text-align:left;"><label for="url">URL</label>&nbsp;						
	        <input type="text" name="url" value="<?php echo $url; ?>" tabindex="0"  minlength="2" maxlength="500" size="70"  /></p>  
	        
	        
	        <p style="text-align:left;"><label for="detalhe">Detalhe</label>&nbsp;						
	      	<textarea name="detalhe" style="width:800px;height:400px;"><?php echo $detalhe; ?></textarea></p>  
	        
	        
	        <p style="text-align:left;"><label for="linguagem">Linguagem</label>&nbsp;						
	        <input type="text" name="linguagem" value="<?php echo $linguagem; ?>" tabindex="0"  maxlength="30" size="20"  /></p> 
	        
	        
	        <p style="text-align:left;"><label for="livre">Código Fonte Aberto</label>&nbsp;						
			<select style="width:100px;height:21px;font-family:arial;font-size:11px;" size="1" class="inputbox" name="codigo_fonte_livre">
				<option value="1" <?php echo ($codigo_fonte_livre==1? "selected":"")?>>Sim</option>
				<option value="0" <?php echo ($codigo_fonte_livre==0? "selected":"")?>>Não</option>
			</select>					
			</p> 
	        
	        <p style="text-align:left;"><label for="application_classification_id">Classificação</label>&nbsp;						
			<select style="width:600px;height:21px;font-family:arial;font-size:13px;" size="1" class="inputbox" name="application_classification_id">
				<option value="1" <?php echo ($application_classification_id==1? "selected":"")?>>Ferramenta</option>
				<option value="2" <?php echo ($application_classification_id==2? "selected":"")?>>Aplicação</option>
			</select>					
			</p> 
			
	        
	        <p style="border:0px solid #000;text-align:right;"> 
	        	<input name="enviar" type="submit" value="Salvar" />
	        	<input name="button" type="button" value="Remover"  onclick="javascript:document.forms[0]['action'].value='del';document.forms[0].submit();"/> 
	        	<input name="button3" type="button" value="Fechar"  onclick="javascript:window.location.href='gridApp.php';"/> 
	        	        
	        </p>
	
	    </fieldset>
	</form>
				

</body>
</html>